def nine_while():
    n=m=1
    while n<10:
        while m<=n:
            print('{}x{}={}\t'.format(n, m, n * m), end='')
            m=m+1
        n=n+1
        m=1
        print()
    print('\n'+'=' * 80)
    n=9
    m=1
    while n>0:
        while m<=n:
            print('{}x{}={}\t'.format(n, m, n * m), end='')
            m=m+1
        n=n-1
        m=1
        print()
    print('\n' + '=' * 80)
    n=1
    while n<10:
        a=10-n
        m=1
        while m<10-n:
            print("{}{}{}{}{}\t".format(' ',' ',' ',' ',' '), end='')
            m=m+1
        while a<10:
            print("{}*{}={}\t".format(10-a, n,(10-a)*n), end='')
            a=a+1
        n=n+1
        print()
    print('\n' + '=' * 80)
    n = 9
    while n > 0:
        a = 10 - n
        m = 1
        while m < 10 - n:
            print("{}{}{}{}{}\t".format(' ', ' ', ' ', ' ', ' '), end='')
            m = m + 1
        while a < 10:
            print("{}*{}={}\t".format(10 - a, n, (10 - a) * n), end='')
            a = a + 1
        n = n - 1
        print()
nine_while()